package com.wufan.day03;

/**
 * 可变个数形参的方法
 *
 * @author SongWufan
 * @date 2021/3/7 21:06
 */
public class MethodArgsTest {
    public static void main(String[] args) {
        MethodArgsTest methodArgsTest = new MethodArgsTest();
        methodArgsTest.show(12);
        methodArgsTest.show("hello");
        methodArgsTest.show("hello","world");
        methodArgsTest.show(new String[]{"AA","BB"});
    }

    public void show(int i) {

    }

    public void show(String s) {

    }

    public void show(String... strings) {
        System.out.println("可变参数");
        for (int i = 0; i < strings.length; i++){
            System.out.println(strings[i]);
        }
    }

    public void show(int i,String... strings){

    }
}
